{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="chirden_title"  lay-verify="required" placeholder="名称" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                            <label class="layui-form-label">七牛分片上传</label>
                            <div class="layui-input-block" >
                                <input type="hidden" name="video" id="qiniuVideo">
                                <button class="layui-btn" style="position: absolute;">选择文件</button>
                                <input class="file-input" type="file" id="select2"  multiple="multiple" accept="video/mp4,video/avi,video/mkv"/>
                                <table class="layui-table">
                                    <colgroup>
                                        <col width="80">
                                        <col width="100">
                                        <col width="200">
                                        <col width="100">
                                    </colgroup>
                                    <thead>
                                    <tr>
                                        <th>文件名称</th>
                                        <th>文件大小</th>
                                        <th>进度</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="fsUploadProgress">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">添加
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<!--—————————————————————七牛云分片上传—————————————————————————-->
<link rel="stylesheet" href="__JS__/qiniu2.0/index.css">
<script type="text/javascript" src='__JS__/qiniu2.0/qiniu.min.js'></script>
<script type="text/javascript" src='__JS__/qiniu2.0/widget.js'></script>
<script type="text/javascript" src='__JS__/qiniu2.0/common.js'></script><!--上传操作-->
<script type="text/javascript" src='__JS__/qiniu2.0/ui.js'></script><!--展示上传表格-->
<script type="text/javascript" src='__JS__/qiniu2.0/uploadWithSDK.js'></script><!--h5上传-->
<script type="text/javascript" src='__JS__/qiniu2.0/main.js'></script><!--调用后台生成token-->
<!--—————————————————————七牛云分片上传—————————————————————————-->
<script>
    //    var editor = wk.wang({elem:'#LAY_editor'});
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
//        form.verify({
//            editor:function(value,item){
//                if(editor.txt.html() == '<p><br></p>'){
//                    return '请填写内容';
//                }
//            }
//        });
        form.on('submit(component-form-element)', function (data) {
//            data.field.new_content = editor.txt.html();
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('add1')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('famous/index1')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });

        var laydate = layui.laydate;
        //同时绑定多个
        lay('.test-item').each(function(){
            laydate.render({
                elem: this
                ,format:'yyyy-MM-dd'
                ,type:'date'
                ,trigger: 'click'
            });
        });
//        form.on('select(role)', function(data){
//            if(data.value == 1){
//                $(".banner_link").removeClass('hidden');
//                $(".banner_cate").addClass('hidden');
//                $(".banner_new").addClass('hidden');
//            }else{
//                $(".banner_link").addClass('hidden');
//                $(".banner_cate").removeClass('hidden');
//                if(banner_cate == 3){
//                    $(".banner_new").removeClass('hidden');
//                }
//            }
//        });
//        form.on('select(role1)', function(data){
//            banner_cate = data.value;
//            if(data.value == 1){
//                $('.banner_new').addClass('hidden');
//            }else if(data.value == 2){
//                $('.banner_new').addClass('hidden');
//            }else {
//                $('.banner_new').removeClass('hidden');
//            }
//        });
    });
</script>

</body>
</html>
